package com.keba.lamp.complaint.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.keba.basic.base.entity.Entity;
import com.keba.basic.encrypt.annotation.Encrypted;
import com.keba.basic.encrypt.annotation.Security;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.EQUAL;
import static com.keba.basic.database.mybatis.conditions.Wraps.EQ;
import static com.keba.lamp.model.constant.Condition.LIKE;


/**
 * <p>
 * 实体类
 * 诉讼状案件
 * </p>
 *
 * @author chaowu.wang
 * @date 2025-06-22 19:13:21
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@Builder
@TableName("ss_case")
@Encrypted
public class Case extends Entity<Long> {
    private static final long serialVersionUID = 1L;

    /**
     * 乐观锁
     */
    @TableField(value = "revision", condition = EQUAL)
    @Version
    private Integer revision;
    /**
     * 是否删除，0-未删除，1-删除
     */
    @TableField(value = "is_del", condition = EQUAL)
    private Integer isDel;
    /**
     * 租户ID
     */
    @TableField(value = "tenant_id", condition = EQUAL)
    private Long tenantId;
    /**
     * 起诉状内容
     */
    @Security
    @TableField(value = "complaint_content", condition = LIKE)
    private String complaintContent;
    /**
     * 案件说明
     */
    @TableField(value = "remark", condition = LIKE)
    private String remark;
    /**
     * 案件名称
     */
    @TableField(value = "case_name", condition = LIKE)
    private String caseName;
    /**
     * 案件来源;[00-小程序 02-后台创建]@Echo(api = EchoApi.DICTIONARY_ITEM_FEIGN_CLASS, dictType = EchoDictType.System.CASE_SOURCE)
     */
    @TableField(value = "case_source", condition = EQUAL)
    private String caseSource;
    /**
     * 案件状态;[00-草稿 10-已完成]@Echo(api = EchoApi.DICTIONARY_ITEM_FEIGN_CLASS, dictType = EchoDictType.System.CASE_STATE)
     */
    @TableField(value = "case_state", condition = EQUAL)
    private String caseState;
    /**
     * 案件类别;[01-贷款 99-其它]@Echo(api = EchoApi.DICTIONARY_ITEM_FEIGN_CLASS, dictType = EchoDictType.System.CASE_TYPE)
     */
    @TableField(value = "case_type", condition = EQUAL)
    private String caseType;
    /**
     * 业务类型[01-起诉状，02-答辩状 ]@Echo(api = EchoApi.DICTIONARY_ITEM_FEIGN_CLASS, dictType = EchoDictType.System.BIZ_TYPE)
     */
    @TableField(value = "biz_type", condition = EQUAL)
    private String bizType;
    /**
     * 起诉状上一次生成时间
     */
    @TableField(value = "last_generate_time", condition = EQUAL)
    private LocalDateTime lastGenerateTime;
    /**
     * 渠道客户id
     */
    @TableField(value = "channel_customer_id", condition = EQUAL)
    private Long channelCustomerId;
    /**
     * 业务类型[01-个人客户案件 02-渠道客户案件]@Echo(api = EchoApi.DICTIONARY_ITEM_FEIGN_CLASS, dictType = EchoDictType.System.TENANT_BUSINESS_TYPE)
     */
    @TableField(value = "business_type", condition = EQUAL)
    private String businessType;
    /**
     * 点击生成诉讼状次数
     */
    @TableField(value = "click_num", condition = EQUAL)
    private Integer clickNum;
    /**
     * 分享手机号
     */
    @TableField(value = "share_tel", condition = EQUAL)
    private String shareTel;
    /**
     * def_user_id(分享登录后赋值）
     */
    @TableField(value = "user_id", condition = EQUAL)
    private Long userId;
    /**
     * 由哪个用户分享
     */
    @TableField(value = "sharer_user_id", condition = EQUAL)
    private Long sharerUserId;
    /**
     * h5/小程序所属
     */
    @TableField(value = "app_id", condition = EQUAL)
    private String appId;
    /**
     * 三方平台 [01咸鱼、02天猫、03抖音、04快手、20自营]@Echo(api = EchoApi.DICTIONARY_ITEM_FEIGN_CLASS, dictType = EchoDictType.System.THIRD_PLATFORM)
     */
    @TableField(value = "third_platform", condition = LIKE)
    private String thirdPlatform;
    /**
     * 客服人员
     */
    @TableField(value = "customer_service", condition = EQ)
    private Long customerService;
    /**
     * 做单员
     */
    @TableField(value = "order_processor", condition = EQ)
    private Long orderProcessor;
    /**
     * 法院名称
     */
    @TableField(value = "court_name", condition = LIKE)
    private String courtName;
    /**
     * 标的金额
     */
    @TableField(value = "case_amount", condition = EQUAL)
    private BigDecimal caseAmount;
    /**
     * 案件备注（不是[案件说明]字段，【案件说明】字段用的是remark）
     */
    @TableField(value = "case_remark", condition = LIKE)
    private String caseRemark;



}
